#ifndef DSPSIMULATOR_INSTRUCTION_SPKERNEL_H
#define DSPSIMULATOR_INSTRUCTION_SPKERNEL_H

#include "dspSimulator/targetMachine/dspInstruction.h"

namespace dspsimulator {
    class SPKERNEL : public DspInstruction {
    public:
        explicit SPKERNEL(u64 address = 0, u32 size = 4) :
                DspInstruction("SPKERNEL", address, size) {}

        SPKERNEL(const SPKERNEL &) = default;

        SPKERNEL(SPKERNEL &&) = default;

        SPKERNEL &operator=(const SPKERNEL &) = default;

        SPKERNEL &operator=(SPKERNEL &&) = default;

        std::string to_string() const override;

        std::shared_ptr<Instruction> clone() const override { return std::make_shared<SPKERNEL>(*this); }

        void compute_fstg_and_fcyc(u32 ii, u32 &fstg, u32 &fcyc);
    protected:

        std::shared_ptr<DspInstruction> decode_standard_instruction(const std::shared_ptr<DspInstructionInfo> &dsp_instruction_info) override;

        std::shared_ptr<DspInstruction> decode_compact_instruction(const std::shared_ptr<DspInstructionInfo> &dsp_instruction_info) override;
    private:
        std::bitset<6> m_fstg_fcyc;
    };
}

#endif //DSPSIMULATOR_INSTRUCTION_SPKERNEL_H
